﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace HowItWentDown
{
    // This class is used to extend the built in classes in C# and XNA, and add extra methods to them
    public unsafe static class Extensions
    {
        /// <summary>
        /// Norma
        /// </summary>
        /// <param name="vec"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public unsafe static Vector3 Normalize(this Vector3 vec, float target)
        {
            float d = MyMath.Distance(vec);
            float r = target / d;
            return vec * r;
        }
    }
}
